import { Select, Skeleton, Space, TimePicker, Watermark } from "antd";
import dayjs from "dayjs";
import { FC, useState, useEffect } from "react";

import { dataFormat } from "../../../units/day";
type Iprop = {
  a?: number;
};
export const AmountCom: FC<Iprop> = (props) => {
  let [format, setFormat] = useState("HH:mm:ss");

  let [loading, setLoading] = useState(true);

  //格式化时间
  let [formatTime, setformatTime] = useState("");

  console.log(props);

  let handleChange = (a: any) => {
    console.log(a);
  };
  let onBlurval = (d: any) => {
    console.log(d.target.value);
  };
  useEffect(() => {
    let a: string = dataFormat(new Date().getTime(), "YYYY-MM-DD hh:mm:ss");
    console.log(a, "格式化时间");
  });
  setTimeout(() => [setLoading(false)], 3000);
  return (
    <div>
      <Watermark content="yuerwang">
        <div style={{height:"80vh"}}>
        <Skeleton active loading={loading}>
          <Select
            defaultValue="lucy"
            style={{ width: 120 }}
            onChange={handleChange}
            options={[
              { value: "Jack", label: "Jack" },
              { value: "Lucy", label: "Lucy" },
              { value: "yiminghe", label: "yiminghe" },
              { value: "Disabled", label: "Disabled" },
            ]}
          />
          <TimePicker
            defaultValue={dayjs(`${new Date()}`, format)}
            format={format}
            onBlur={onBlurval}
          />
        </Skeleton>
        </div>
        
      </Watermark>
    </div>
  );
};
